package com.szboanda.parser;

public enum DataBaseType {

    Oracle("Oracle"),
    Mysql("MySQL"),
    SqlServer("Microsoft SQL Server");


    private final String type;

    DataBaseType(String type) {
        this.type = type;
    }

    public String getType() {
        return this.type;
    }

    /**
     * 根据枚举类型得到枚举值
     * @param databaseName
     * @return
     */
    public static DataBaseType toEnum(String databaseName){
        if (Oracle.getType().equals(databaseName)) {
            return Oracle;
        } else if (Mysql.getType().equals(databaseName)) {
            return Mysql;
        } else if (SqlServer.getType().equals(databaseName)) {
            return SqlServer;
        } else {
            return null;
        }
    }
}
